﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace GongXianDCUI
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }

        protected void Application_EndRequest()
        {
            int statusCode = Response.StatusCode;
            if (statusCode == 404)
            {
                Response.ClearContent();
                string url = Server.MapPath("/Views/Shared/404Page.html");
                Response.WriteFile(url);
                Response.Flush();
            }
        }
    }
}
